#! /bin/bash

DIR_PATH="/home/core"
DIR_DATA="$DIR_PATH/data/"
DIR_DOCKER="$DIR_PATH/docker/"

sudo mkdir -p $DIR_DATA
${DIR_DOCKER}shell/docker_close_selinux

#if vps
#sudo dd if=/dev/zero of=/swap bs=1024 count=1024000
#sudo mkswap /swap
#sudo swapon /swap
#sudo touch /etc/fstab
#sudo chown -R core:core /etc/fstab
#echo "swap                    /swap                   swap    defaults        0 0" >> /etc/fstab
#end if

sleep 5

sudo touch /etc/sysctl.conf
sudo chown -R core:core /etc/sysctl.conf
echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf

#for SERVICE_NAME in autorun dante
#do
#    ${DIR_DOCKER}shell/ss ${SERVICE_NAME}
#done

#if [ ! -d "$DIR_DATA" ]
#then
#    sudo chown -R root:root $DIR_DATA
#fi
